#ifndef CEXPLAINRESULT_H
#define CEXPLAINRESULT_H

#include <QList>
#include <QString>
#include <QMultiMap>
#include <QDomDocument>
#include <QNetworkReply>


// an abstract class that is used to send requests and get results
class CRequestGet : public QObject
{
    Q_OBJECT

public:
    CRequestGet(QObject* parent = 0);

    virtual ~CRequestGet();

public:
    int getCommandID();

    QList<QString>& getInteresedItemList();

    QMultiMap<QString, QString>& getResult();

    const QString getResult(QString key);

    const QString getReplyErrorString();

    void deleteReply();

    bool isReplyStringRight(QString* pErrorStr = 0, int *pErrorLine = 0, int *pErrorColumn = 0);

    int  getKeyCount() { return m_ArgCount; }

    bool sendRequest(QObject *signalReciever, QString ipAddress, QString* arg, int count);

public:

    virtual QList<QString>& formInteresedItemList() = 0;

    virtual QMultiMap<QString, QString>* formResult() = 0;


protected:
    QList<QString>           m_interestedList;

    QDomDocument             *m_pXMLDocument;

    QMultiMap<QString, QString> m_result;

    int                      m_commandID;

    int                      m_ArgCount;

protected:
    QNetworkAccessManager    *m_networkAccessManager;

    QNetworkReply            *m_pListReply;

    QString                  m_xmlString;
};

#endif // CEXPLAINRESULT_H
